let mySet = new Set<any>()

mySet.add(1)
mySet.add(5)
mySet.add(5)
mySet.add('hello')
mySet.add({
  name: 'jet'
})
mySet.add([1, 3, 5])
mySet.add([1, 3, 5])

console.log(mySet.has(5))
console.log(mySet.has(6))
console.log(mySet.has([1, 3, 5]))

mySet.delete(5)

// 迭代
for (const ite of mySet) {
  console.log(ite)
}


// 集合转数组
const arr = [...mySet]
console.log('arr:', arr)

const arr2 = Array.from(mySet)
console.log('arr2:', arr2)

// arr转集合
const arr3 = [1, 2, 3, 'hello', [1, 2]]
const set2 = new Set(arr3)
console.log(set2)


console.log('mySet:', mySet)
